package com.mallcloud.mall.app.api.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.Optional;

@ApiModel(value = "ProOrderCouponRefundDone", description = "券退款信息修改")
@Data
@ToString
public class ProOrderCouponRefundDone implements Serializable {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty("券序号")
	private Long couponId;
	@ApiModelProperty("退款单号")
	private String orderNo;

	@ApiModelProperty("过程返回id")
	private Integer messageId;
	@ApiModelProperty("过程返回信息")
	private String message;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}

	public ProOrderCouponRefundDone(Long couponId, String orderNo) {
		this.couponId = couponId;
		this.orderNo = orderNo;
	}
}
